import 'package:flutter/material.dart';

class StackComp extends StatelessWidget {
  const StackComp({super.key});

  @override
  Widget build(BuildContext context) {
    return Container(
        width: double.infinity,
        height: double.infinity,
        decoration: const BoxDecoration(
          color: Colors.black12,
        ),
        alignment: Alignment.center,
        child: Stack(
          // 裁剪行为
          clipBehavior: Clip.none,
          // 对齐方式
          alignment: Alignment.bottomCenter,
          children: [
            Container(
              width: 300,
              height: 300,
              color: Colors.red,
            ),
            Container(
              width: 200,
              height: 200,
              color: Colors.green,
            ),
            Positioned(
                top: 50,
                right: 0,
                child: Image.asset('assets/open_eyes.png',
                    width: 100, height: 100))
          ],
        ));
  }
}
